<template>
  <div id="contentBox">
    <div class="searchBox">
      <el-form :inline="true" ref="searchForm" :model="searchForm" label-width="96px">
        <el-form-item label="申请日期起" prop="startDate">
          <el-date-picker :editable="false" @change="debounceSeach" v-model="searchForm.startDate" type="date" placeholder="选择日期" :picker-options="startDateOpt">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="申请日期止" prop="endDate">
          <el-date-picker :editable="false" @change="debounceSeach" v-model="searchForm.endDate" type="date" placeholder="选择日期" :picker-options="endDateOpt">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="订单号" prop="orderNumber">
          <el-input v-model="searchForm.orderNumber" placeholder="请输入搜索内容..." @input.native="debounceSeach"></el-input>
        </el-form-item>
        <el-form-item label="融资经销商" prop="dealerName">
          <el-input v-model="searchForm.dealerName" placeholder="请输入搜索内容..." @input.native="debounceSeach">
          </el-input>
        </el-form-item>

        <el-form-item label="合同状态" prop="status" >  
				 		<el-select @change="changeQuey()" v-model="searchForm.status"  placeholder="选择合同状态"    >
				 			<el-option label="全部"  value="" ></el-option>
					     	<el-option label="未签署"  value="1" >   
	                      	</el-option>   
	                        <el-option label="签署中"  value="2" >   
	                      	</el-option>   
	                        <el-option label="已完成"  value="3"  >   
	                      	</el-option>   
					    </el-select> 
				</el-form-item>
        
         <el-form-item style="float:right">
          <el-button @click="resetSearchForm('searchForm')">重置</el-button>
        </el-form-item>

      </el-form>
    </div>
    <div id="tableBox" style="margin:0 25px;">
      <el-table :data="tableData.data" border>
        <el-table-column label="订单号" fixed>
          <template scope="scope">
            <span>{{ scope.row.carOrder.orderNumber }}</span>
          </template>
        </el-table-column>
        <el-table-column label="融资经销商">
          <template scope="scope">
            <span>{{ scope.row.carOrder.dealerName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="融资总金额（元）">
          <template scope="scope">
            <span>{{ scope.row.mortgageSumMoney| toFixed2 }}</span>
          </template>
        </el-table-column>
         <el-table-column label="合同名称">
          <template scope="scope">
            <span>{{ scope.row.outName }}</span>
          </template>
        </el-table-column>
         <el-table-column label="合同状态">
          <template scope="scope">
            <span v-for='(item,key) in scope.row.contractEnumsVO' :key='key'>{{ item }}</span>
            <!-- <span>{{ scope.row.contractEnumsVO }}</span> -->
            
          </template>
        </el-table-column>
         <el-table-column label="后台签署状态">
          <template scope="scope">
            <span>{{ scope.row.userBStatusVO }}</span>
          </template>
        </el-table-column>
         <el-table-column label="资金方签署状态">
          <template scope="scope">
            <span>{{ scope.row.userFunderStatusVO }}</span>
          </template>
        </el-table-column>
         <el-table-column label="经销商签署状态">
          <template scope="scope">
            <span>{{ scope.row.userAStatusVO }}</span>
          </template>
        </el-table-column>
         <el-table-column label="SPV签署状态">
          <template scope="scope">
            <span>{{ scope.row.userSpvStatusVO }}</span>
          </template>
        </el-table-column>
        <el-table-column label="申请时间">
          <template scope="scope">
            <span>{{ getDate(scope.row.addDate)}}</span>
          </template>
        </el-table-column>

        <el-table-column label="操作" fixed="right">
          <template scope="scope">
            <el-button size="mini"  type="danger" @click.native="formIsEdit(scope.row.carOrderId)"  v-for="(item, index) in scope.row.contractEnumsVO"  :key="index" v-if="index != statusFnished && index!=0 && userType === 0">废弃</el-button>
      
            <el-button size="mini" type="info" @click="openContract(scope.row.id)">查看</el-button>
            
            <el-button size="mini" type="primary"  @click="handleDown(scope.row.contractId)">下载</el-button>            
          </template>
        </el-table-column>
      </el-table>

    </div>
    <el-dialog title="基础信息" :visible.sync="dialogSendData.dialogFormVisible" :lock-scroll='true'
      top=5% :close-on-click-modal="false">
      <Popup v-if="dialogSendData.dialogFormVisible" :dialogSendData="dialogSendData" :id='id' v-on:Refresh="seachData"></Popup>
    </el-dialog>

    <div class="block" style="text-align: center;margin-top: 15px;position:relative;">
		    <pagination v-on:refreshSeachData="seachData()"  :tableData="tableData" :searchForm="searchForm"></pagination>
		</div>
  </div>
</template>


<script src='./index.js'>


</script>



